//
// Created by Zhangwj on 2023/9/25.
//

#ifndef COMPILE_TASK2_FUNCDEFNODE_H
#define COMPILE_TASK2_FUNCDEFNODE_H


#include <memory>
#include "SyntaxTreeNode.h"
#include "FuncTypeNode.h"
#include "IdentNode.h"
#include "../Parser.h"
#include "FuncFParamsNode.h"
#include "BlockNode.h"

class FuncDefNode : public SyntaxTreeNode {
public:
    //FuncDef → FuncType Ident '(' [FuncFParams] ')' Block
    std::unique_ptr<FuncTypeNode> FuncType;
    std::unique_ptr<IdentNode> Ident;
    std::unique_ptr<FuncFParamsNode> FuncFParams;
    std::unique_ptr<BlockNode> Block;

    static std::unique_ptr<FuncDefNode> FuncDefParser(Parser &parser);
};


#endif //COMPILE_TASK2_FUNCDEFNODE_H
